package com.filldream.fastboot.web.controller.common;

import com.alibaba.fastjson2.JSONObject;
import com.filldream.fastboot.common.okutil.stock.cf.comment.dto.CfComment;
import com.filldream.fastboot.common.okutil.stock.commonComment.CommonCommentUtil;
import com.filldream.fastboot.common.okutil.stock.ths.top.ThsTopUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@AllArgsConstructor
@Api(tags = "股评管理")
@RestController
@RequestMapping("/common/stockComment")
public class StockCommentController {

    @GetMapping(value = "/list")
    @ApiOperation(value = "获取最新的股评",notes = "获取最新的股评")
    public List<CfComment> list(String codes) {
        return CommonCommentUtil.getComments(codes);
    }

    @GetMapping(value = "/thsTop")
    @ApiOperation(value = "获取同花顺热榜数据",notes = "获取同花顺热榜数据")
    public JSONObject thsTop(String type) {
        return ThsTopUtil.getThsTop(type);
    }

}
